1. Field of the Invention
The present invention relates to an image processing device, an image capture device, an image processing method, and an image processing program.
2. Description of the Related Art
A plurality of light receiving elements (photoelectric conversion elements) are formed in a two-dimensional array on a light receiving surface of a solid-state imaging element. Among the light receiving elements, some light receiving elements are used as phase difference detecting pixels. The solid-state imaging element can detect the distance to a main object in a captured image from distance measuring signals detected by the phase difference detecting pixels (for example, JP2010-62640A and JP2012-4729A). An image capture device using the solid-state imaging element can perform a phase difference AF process on the basis of the signals detected by the phase difference detecting pixels.
The phase difference detecting pixel has a different structure from the light receiving element (hereinafter, referred to as an imaging pixel) other than the phase difference detecting pixel on the light receiving surface. As disclosed in JP2010-62640A and JP2012-4729A, in the phase difference detecting pixel, the size of an opening in a light shielding film is less than that in the imaging pixel. Therefore, the amount of light received by the phase difference detecting pixel is less than the amount of light received by the imaging pixel. That is, when an image is generated, considering the distance measuring signal detected by the phase difference detecting pixel and the signal detected by the imaging pixel as the same signal, image data at the position of the phase difference detecting pixel is degraded as compared to image data around the phase difference detecting pixel on the light receiving surface.
When the image data of an object is generated, it is necessary to correct the image data at the position of the phase difference detecting pixel. As disclosed in JP2012-4729A, there are two types of correction method, that is, gain correction and interpolation correction other than the gain correction.
The gain correction is a method which multiplies the value of the signal detected by the phase difference detecting pixel by a predetermined gain to correct the signal. For example, in the gain correction, the value of the signal detected by the phase difference detecting pixel is multiplied by a gain based on the ratio between the amount of opening of the light shielding film in the phase difference detecting pixel and the amount of opening of the light shielding film in the imaging pixel.
The interpolation correction is a correction method which treats the phase difference detecting pixel as a defect pixel and replaces image data at the position of the phase difference detecting pixel with the average value (for example, the weighted average value) of the output signals from the imaging pixels in the vicinity of the phase difference detecting pixel.
The interpolation correction and the gain correction have advantages and disadvantages and are appropriately used according to a captured scene. The technique disclosed in JP2012-4729A detects the edge of the object image, switches between the interpolation correction and the gain correction according to the amount of edge, and corrects image data.